<template>
	<view>
		<view class="follow-pos">
			<view class="follow-img">
				<image class="fengrui-img" show-menu-by-longpress="true" :src="wxSet.public_follow" mode="widthFix" />
			</view>

			<view class="follow-title title">
				长按捕捉动态
			</view>
			<view class="follow-descr">
				最新动态最新知道，任何内容不错过
			</view>
		</view>
	</view>
</template>

<script>
	// 获取应用实例
	const app = getApp()
	export default {
		data() {
			return {
				wxSet:[]
			}
		},
		onLoad() {
			if (app.globalData.wxSet == '') {
				//（解决异步）
				app.on('wxSet', this.changeToken.bind(this));
			} else {
				this.wxSet = app.globalData.wxSet;
			}
		
			// 微信分享盆友圈
			uni.showShareMenu({
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline']
			})
		},
		// 分享好友配置
		onShareAppMessage(res) {
			if (res.from === 'button') { // 来自页面内分享按钮
				console.log(res.target)
			}
			return {
				title: this.wxSet.share_title,
				imageUrl: this.wxSet.share_title_url,
				path: '/pages/index/index'
			}
		},
		methods: {
			//（解决异步）
			changeToken() {
				this.wxSet = app.globalData.wxSet;
			},
		}
	}
</script>

<style>
	.follow-pos {
		position: absolute;
		width: 100%;
		top: 40%;
		left: 50%;
		transform: translate(-50%, -50%);
	}

	.follow-img {
		height: auto;
		width: 66%;
		border-radius: 40rpx;
		border: 1px solid rgb(204, 204, 204);
		padding: 20rpx;
		margin: 200rpx auto 0rpx auto;

	}

	.follow-title {
		margin-top: 50rpx;
		text-align: center;
	}

	.follow-descr {
		text-align: center;
		font-size: 26rpx;
		color: #ADADAD;

	}
</style>